<include file="public@header" />
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:url('AdminLogs/index')}">后台操作日志</a></li>
        <li class="active"><a href="{:url('AdminLogs/taskLog')}">计划任务日志</a></li>
    </ul>
    <form method="get" action="{:url('AdminLogs/taskLog')}">
        <div class="well form-inline margin-top-20">
            任务名:
            <input type="text" class="form-control" name="action" id="task_name" style="width: 120px;" value="{:input('request.action/s','')}" placeholder="请输入任务名">
            启动时间：
            <input id="sDay" class="form-control js-date" style="width: 105px;" type="text" value="{:input('sDay',date('Y-m-d',strtotime('-2 days')))}" name="sDay">
            ~
            <input id="eDay" class="form-control js-date" style="width: 105px;" type="text" value="{:input('eDay',date('Y-m-d'))}" name="eDay">
            <input type="submit" class="btn btn-primary" value="搜索" />
            <a class="btn btn-success js-ajax-dialog-btn" data-fields="task_name" href="{:url('runTask')}">执行任务</a>
        </div>
        <table class="table table-hover table-bordered">
            <thead>
            <tr>
                <th width="8%">任务名</th>
                <th width="10%">启动时间</th>
                <if condition="APP_NAME == 'center'">
                <th width="10%">生成队列</th>
                <th width="10%">获取队列</th>
                </if>
                <th width="10%">完成</th>
                <th width="10%">失败</th>
                <th width="10%">终止</th>
                <th width="15%">参数</th>
                <th>描述</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="data" item="vo">
                <tr>
                    <td>{$vo.action}</td>
                    <td>{$vo.run_time|date="Y-m-d H:i:s"}</td>
                    <if condition="APP_NAME == 'center'">
                    <td><if condition="$vo['create_read_time'] != 0">{$vo.create_read_time|date="Y-m-d H:i:s"}</if></td>
                    <td><if condition="$vo['get_read_time'] != 0">{$vo.get_read_time|date="Y-m-d H:i:s"}</if></td>
                    </if>
                    <td><if condition="$vo['success_time'] != 0">{$vo.success_time|date="Y-m-d H:i:s"}</if></td>
                    <td><if condition="$vo['fail_time'] != 0">{$vo.fail_time|date="Y-m-d H:i:s"}</if></td>
                    <td><if condition="$vo['kill_time'] != 0">{$vo.kill_time|date="Y-m-d H:i:s"}</if></td>
                    <td><a href="javascript:;" class="alert_window" alert-data='{$vo["param"]}'>{:strCut($vo['param'], 15, '...')}</a></td>
                    <td><a href="javascript:;" class="alert_window" alert-data='{$vo["msg"]}'>{:strCut($vo['msg'], 15, '...')}</a></td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <div class="pagination">{$page}</div>
    </form>
</div>
<include file="public@footer" />